Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][FIX] avoid error in aged partner balance report #1217

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

huguesdk
Copy link
Member

@huguesdk huguesdk commented Aug 14, 2024

avoid error in aged partner balance report when processing journal items without a due date (account.move.line.date_maturity field is not set).

here is the error that happens without this fix:

Traceback (most recent call last):
  File "/home/odoo16/src/odoo/odoo/http.py", line 1638, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "/home/odoo16/src/odoo/odoo/service/model.py", line 133, in retrying
    result = func()
  File "/home/odoo16/src/odoo/odoo/http.py", line 1665, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
  File "/home/odoo16/src/odoo/odoo/http.py", line 1779, in dispatch
    return self.request.registry['ir.http']._dispatch(endpoint)
  File "/home/odoo16/src/odoo/addons/website/models/ir_http.py", line 237, in _dispatch
    response = super()._dispatch(endpoint)
  File "/home/odoo16/src/odoo/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
    result = endpoint(**request.params)
  File "/home/odoo16/src/odoo/odoo/http.py", line 700, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "/home/odoo16/src/oca/reporting-engine/report_xml/controllers/report.py", line 24, in report_routes
    return super().report_routes(
  File "/home/odoo16/src/odoo/odoo/http.py", line 700, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "/home/odoo16/src/oca/reporting-engine/report_xlsx_helper/controllers/main.py", line 52, in report_routes
    return super().report_routes(reportname, docids, converter, **data)
  File "/home/odoo16/src/odoo/odoo/http.py", line 700, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "/home/odoo16/src/oca/reporting-engine/report_xlsx/controllers/main.py", line 49, in report_routes
    return super().report_routes(reportname, docids, converter, **data)
  File "/home/odoo16/src/odoo/odoo/http.py", line 700, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "/home/odoo16/src/odoo/addons/web/controllers/report.py", line 39, in report_routes
    html = report.with_context(context)._render_qweb_html(reportname, docids, data=data)[0]
  File "/home/odoo16/src/oca/account-financial-reporting/account_financial_report/models/ir_actions_report.py", line 19, in _render_qweb_html
    return super(IrActionsReport, obj)._render_qweb_html(
  File "/home/odoo16/src/odoo/odoo/addons/base/models/ir_actions_report.py", line 913, in _render_qweb_html
    data = self._get_rendering_context(report, docids, data)
  File "/home/odoo16/src/odoo/odoo/addons/base/models/ir_actions_report.py", line 928, in _get_rendering_context
    data.update(report_model._get_report_values(docids, data=data))
  File "/home/odoo16/src/oca/account-financial-reporting/account_financial_report/report/aged_partner_balance.py", line 419, in _get_report_values
    )._get_move_lines_data(
  File "/home/odoo16/src/oca/account-financial-reporting/account_financial_report/report/aged_partner_balance.py", line 240, in _get_move_lines_data
    ag_pb_data = self._calculate_amounts(
  File "/home/odoo16/src/oca/account-financial-reporting/account_financial_report/report/aged_partner_balance.py", line 74, in _calculate_amounts
    days_difference = abs((today - due_date).days)
TypeError: unsupported operand type(s) for -: 'datetime.date' and 'bool'

this error did not happen before #1140 was merged.

avoid error in aged partner balance report when processing journal items
without a due date (account.move.line.date_maturity field is not set).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant